package com.huluobo.a2202mvvm_im_douyindemo.mvvmDemo;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.huluobo.a2202mvvm_im_douyindemo.mvpDemo.UserBean;

/**
 * Created by LC on 2024/4/19.
 * ViewModel主要功能,实例化对应的repo,给repo具体的实参成功和失败的LiveData
 */
public class LoginViewModel extends ViewModel {
    MutableLiveData<UserBean> success = new MutableLiveData<>();
    MutableLiveData<String> failed = new MutableLiveData<>();
    LoginRepo loginRepo = new LoginRepo();

    public void login(String username, String password) {
        loginRepo.login(username, password, success, failed);
    }

}
